package com.ruoyi.cms.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cms.mapper.CmsFormMapper;
import com.ruoyi.cms.domain.CmsForm;
import com.ruoyi.cms.service.ICmsFormService;

/**
 * 留言板Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-01
 */
@Service
public class CmsFormServiceImpl implements ICmsFormService 
{
    @Autowired
    private CmsFormMapper cmsFormMapper;

    /**
     * 查询留言板
     * 
     * @param id 留言板主键
     * @return 留言板
     */
    @Override
    public CmsForm selectCmsFormById(Long id)
    {
        return cmsFormMapper.selectCmsFormById(id);
    }

    /**
     * 查询留言板列表
     * 
     * @param cmsForm 留言板
     * @return 留言板
     */
    @Override
    public List<CmsForm> selectCmsFormList(CmsForm cmsForm)
    {
        return cmsFormMapper.selectCmsFormList(cmsForm);
    }

    /**
     * 新增留言板
     * 
     * @param cmsForm 留言板
     * @return 结果
     */
    @Override
    public int insertCmsForm(CmsForm cmsForm)
    {
        cmsForm.setCreateTime(DateUtils.getNowDate());
        return cmsFormMapper.insertCmsForm(cmsForm);
    }

    /**
     * 修改留言板
     * 
     * @param cmsForm 留言板
     * @return 结果
     */
    @Override
    public int updateCmsForm(CmsForm cmsForm)
    {
        return cmsFormMapper.updateCmsForm(cmsForm);
    }

    /**
     * 批量删除留言板
     * 
     * @param ids 需要删除的留言板主键
     * @return 结果
     */
    @Override
    public int deleteCmsFormByIds(Long[] ids)
    {
        return cmsFormMapper.deleteCmsFormByIds(ids);
    }

    /**
     * 删除留言板信息
     * 
     * @param id 留言板主键
     * @return 结果
     */
    @Override
    public int deleteCmsFormById(Long id)
    {
        return cmsFormMapper.deleteCmsFormById(id);
    }
}
